#include <iostream>
#include <Date.h>
#include <ctime>

using namespace std;

int main()
{
    time_t nowtime;
    time(&nowtime);
    struct tm local;
    localtime_s(&local,&nowtime);
    int year = local.tm_year +1900;
    int month = local.tm_mon+1;
    int day = local.tm_mday;
    Date datel(year,month,day);
    datel.show();
    char *p = datel.toString();
    cout <<p<<endl;
    Date date2(p);
    date2.show();
    cout<<"10天前:";
    Date date3=date2.addDays(10);
    date3.show();
    cout<<"10天后:";
    Date date4=date2.addDays(10);
    date4.show();
    Date date5;
    cout <<"After modify,Date date5 is :";
    date5.show();
    date5.setDate(2015,2,2);
    cout <<"After modify,Date date5 is:";
    date5.show();
    cout << date5. getYear() <<":";
    cout << date5. getMonth() <<":";
    cout << date5. getDay() <<endl;
    Date date6(2014,12,31);
    int days = date5.subDate(date6);
    cout <<"days="<<days<<endl;
    return 0;




}


